@extends('admin.index')
@section('content')
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>网站信息</title>  
    <link rel="stylesheet" href="{{asset ('admins/css/pintuer.css ')}}">
    <link rel="stylesheet" href="{{asset ('admins/css/admin.css ')}}">
    <script src="{{asset ('admins/js/jquery.js ')}}"></script>
    <script src="{{asset ('admins/js/pintuer.js ')}}"></script>  
</head>
    <body>
    <div class="panel admin-panel">
      <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong></div>
      <div class="padding border-bottom">  
      <a class="button border-yellow" href="{{url('admin/linklist/create')}}"><span class="icon-plus-square-o"></span> 添加内容</a>
      </div> 
      <form style='display:none;' action='{{url("linklist")}}' method='post' name='myform'>
        <input type='hidden' name='_token' value='{{ csrf_token() }}'>
        <input type='hidden' name='_method' value='DELETE'>
      </form>
      <table class="table table-hover text-center">
        <tr>
          <th width="5%">ID</th>  
          <th width="5%">链接名</th>   
          <th>URL</th>      
          <th width="250">操作</th>
        </tr>
        @foreach($list as $k=>$v)
        <tr>
          <td width="5%">{{$v->links_id}}</td>
          <td width="20%">{{$v->links_name}}</td>
          <td>{{$v->links_url}}</td>
          <td><a href="javascript:doDel({{ $v->links_id }})">删除</a>&nbsp;|
          &nbsp;<a href="linklist/{{$v->links_id}}/edit">修改</a></td>
        </tr>
        @endforeach
      </table>
    </div>
    <br>
    <div style="margin-left:1050px;">

      {{ $list->links() }}
    </div>
    
    <script type="text/javascript">
      function doDel(id)
      {
        if(confirm("你确定要删除吗？")){
          var form = document.myform;
          form.action = '/admin/linklist/'+id;
          form.submit();
        }
      }
    </script>
    </body>
@stop